class GroupListController {
    constructor(getGroupList, getGroupaliasList){

		this.getGroupList      = getGroupList;
		this.getGroupaliasList = getGroupaliasList;

        // 小组列表
        this.getGroupList && this.getGroupList.code == 0 && (this.grouplist = this.getGroupList.data);

        // 分组列表
        this.getGroupaliasList && this.getGroupaliasList.code == 0 && (this.groupaliaslist = this.getGroupaliasList.data);

        if (this.grouplist.length > 0 && this.groupaliaslist.length > 0) {
	        angular.forEach(this.grouplist, (value, index) => {
	    		angular.forEach(this.groupaliaslist, (n, i) => {
	    			value.group_name == n.group_name && (value.alias = n.alias)
	    		})
	    	})
    	}

        console.log(this.getGroupList)

    }
}

GroupListController.$inject = ['getGroupList', 'getGroupaliasList']; 

export default GroupListController;